package DataBase;

import java.sql.PreparedStatement;
import java.sql.SQLException;

import DataObjects.Supplier;

public class DeleteMenu {
	
	
	
	private Supplier supplier;
	private String menuID;
	
	
	public DeleteMenu(String menuuID ) {
		
		this.menuID=menuuID;
	   
	}

	public void deleteMenu()
	{

		SQLConnection sc=new SQLConnection();
		
		try {
			
			PreparedStatement ps1 = sc.getConnection().prepareStatement("DELETE FROM menu WHERE  Mid=? ");	
			 ps1.setString(1,menuID);
			sc.getConnection().setAutoCommit(false);
			ps1.executeUpdate();
			sc.getConnection().commit();
			ps1.close();
			 sc.getConnection().close();
		}
		
		catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		}
		
		

}
